package mx.com.theboard.client.notas;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Image;

import mx.com.theboard.client.controllers.NotaController;
import mx.com.theboard.client.menu.BotonMenu;
import mx.com.theboard.shared.entidades.Nota;
import mx.com.theboard.shared.entidades.TipoNota;


public class BotonEditarNota extends BotonMenu {
	private NotaController notacontroller;
	public BotonEditarNota(NotaController notacontroller) {
		super("save.png", "tbbotonnota");
		super.setSize("30px", "30px");
		this.notacontroller = notacontroller;
	}
	
	@Override
	public void onClick(ClickEvent event) {
		Image image = new Image("imagenes/loader.gif");
		image.setStyleName("gwt-Image");
		image.setSize("30px", "30px");	
		AbsolutePanel abp = new AbsolutePanel();
		abp.setWidth("30px");
		abp.setHeight("10");
		abp.add(image,0,10);
		content.add(abp,0,0);
		
		
		Nota nota =notacontroller.getNota();
		TBNotaI tbnota = notacontroller.getTbnota();
		tbnota.update(nota);
		notacontroller.guardar(abp);
	}
}
